<html>
<head>
    <title>
        Gestalt Sample: 2D drawing with Canvas
    </title>
    <script src="../js/jquery.js" type="text/javascript"></script>
    <script src="../js/gestalt.js" type="text/javascript"></script>

</head>
<body>
      
<a href="../index.html">Back</a>
<h2>Different ways to share scope between Gestalt instances</h2>
<p>The <span id="speed">slow</span> brown fox <span id="action">flies</span> over the lazy <span id="animal">cat</span>.</p>

<!-- Global scope -->
<script language="python">
document.speed.innerHTML = "quick"
document.action.innerHTML = "jumps"
</script>

<!-- Local scope-->
<script language="python" id="animal">
animal = "donkey"
document.animal.innerHTML = animal
</script>

<!-- Global scope -->
<script language="python">
#The following statement won't work because animal is not defined within the 
#scope of this script
#document.animal.innerHTML = animal
animal = "dog"
document.animal.innerHTML = animal
</script>

<!--  Local scope -->
<script language="python" id="animal">
document.animal.innerHTML = animal
</script>

</body>
</html>
    